Describe Ron's fix.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Dec 2003 22:13:34 +0000 (22:13 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Dec 2003 22:13:34 +0000 (22:13 +0000)
gpsbabel/gpx.c

index 06604921073782fce660614310c270f4e93504ae..f40512b66b8367c5ca23738b5b19590179aa94b0 100644 (file)
@@ -783,6 +783,19 @@ gpx_read(void)
 
        while (!done) {
                if ( fd ) {
+                       /* 
+                        * The majority of this block (in fact, all but the 
+                        * call to XML_Parse) are a disgusting hack to 
+                        * correct defective GPX files that Geocaching.com
+                        * issues as pocket queries.   They contain escape
+                        * characters as entities (&#x00-&#x1f) which makes
+                        * them not validate which croaks expat and torments
+                        * users.
+                        *
+                        * Look for '&' in the last 6 chars.   If we find
+                        * it, strip it, then read byte-at-a-time until
+                        * we find a non-entity.
+                        */
                        char *badchar;
                        char *semi;
                        len = fread(buf, 1, sizeof(buf)-7, fd);